package com.innovation.chengzhangriji.http;

public class BabyAddRequestBody {

    private static final int LENGTH = 9;

    private static final String NAME = "NickName";
    private static final String STATE = "GrowthStageID";
    private static final String MEMBER_NAME = "UserMemberName";
    private static final String IMAGE_URL = "LogoPath";
    private static final String GENDER = "Sex";
    private static final String BIRTHDAY = "Birthday";
    private static final String LAST_DATE = "LastMenstrualPeriod";
    private static final String DUE_DATE = "ExpectedDateChildbirth";
    private static final String DIARY_BOOK_NAME = "DiaryBookName";

    private Change[] mChanges;

    public BabyAddRequestBody() {
        mChanges = new Change[LENGTH];
        for (int i = 0; i < LENGTH; i++) {
            mChanges[i] = new Change();
        }
        mChanges[0].setKey(NAME);
        mChanges[1].setKey(STATE);
        mChanges[2].setKey(MEMBER_NAME);
        mChanges[3].setKey(IMAGE_URL);
        mChanges[4].setKey(GENDER);
        mChanges[5].setKey(BIRTHDAY);
        mChanges[6].setKey(LAST_DATE);
        mChanges[7].setKey(DUE_DATE);
        mChanges[8].setKey(DIARY_BOOK_NAME);


        mChanges[5].setValue(""+Client.EMPTY_TIME);
        mChanges[6].setValue(""+Client.EMPTY_TIME);
        mChanges[7].setValue(""+Client.EMPTY_TIME);

    }

    public Change[] getBabyAddRequestBody() {
        return mChanges;
    }

    public String getName() {
        return mChanges[0].getValue();
    }

    public void setName(String name) {
        mChanges[0].setValue(name);
        mChanges[8].setValue(getName() + "的成长日记");
    }

    public String getState() {
        return mChanges[1].getValue();
    }

    public void setState(int state) {
        mChanges[1].setValue("" + state);
    }

    public String getParentName() {
        return mChanges[2].getValue();
    }

    public void setParentName(String memberName) {
        mChanges[2].setValue(memberName);
    }

    public String getImageUrl() {
        return mChanges[3].getValue();
    }

    public void setImageUrl(String imageUrl) {
        mChanges[3].setValue(imageUrl);
    }

    public String getGender() {
        return mChanges[4].getValue();
    }

    public void setGender(int gender) {
        mChanges[4].setValue("" + gender);
    }

    public String getBirthday() {
        return mChanges[5].getValue();
    }

    public void setBirthday(long birthday) {
        mChanges[5].setValue("" + birthday);
    }

    public String getLastDate() {
        return mChanges[6].getValue();
    }

    public void setLastDate(long lastDate) {
        mChanges[6].setValue("" + lastDate);
    }

    public String getDueDate() {
        return mChanges[7].getValue();
    }

    public void setDueDate(long dueDate) {
        mChanges[7].setValue("" + dueDate);
    }

    public void getDiaryBookName() { mChanges[8].getValue(); }

}
